#include "Polynomial.H"
using namespace std;
int main(int argc, const char **argv)
{
    cout << "-----------------------Test Poly------------------------" << endl;
    RealVect coef1 = {1, 0, -4.0, 5, 0, 0, 0};
    RealVect coef2 = {-1, 9.122, 1e-5, 3.2, -4.3};
    Polynomial<Real> P1({1, 0, -4.0, 5, 0, 0, 0}), P2(coef2);
    cout<<"////Expected:依次存储常数项至最高次项的实系数（末尾项若不是常数项，系数必须非0;若为0,则自动抹去）"<<endl;
    cout<<P1<<" "<<P2<<endl;
    Polynomial<Real> p1, p2, p3, p4, p5, p6;
    Real a = 10.0;
    cout<<"////Expected:实系数多项式的加，减，乘(及数乘)，求导，求值，与格式化输出"<<endl;
    p1 = a * P1;
    p2 = P1 + P2;
    p3 = p1 - p2;
    p4 = P1;
    p4 = p4 * P2;
    p5 = p4.derivate();
    p6 = p5.derivate();
    cout << P1 << P2 << p1 << p2 << p3 << p4 << p5 << p6 << p6.eval(0) << endl;
    return 0;
};